package com.fs.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.fs.domain.WorkerCertificationAudit;
import com.fs.service.IWorkerCertificationAuditService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 服务人员认证审核Controller
 *
 * @author ruoyi
 * @date 2024-10-18
 */
@RestController
@RequestMapping("/workercertificationaudit/workercertificationaudit")
public class WorkerCertificationAuditController extends BaseController {
    @Autowired
    private IWorkerCertificationAuditService workerCertificationAuditService;

    /**
     * 查询服务人员认证审核列表
     */
    // @PreAuthorize("@ss.hasPermi('workercertificationaudit:workercertificationaudit:list')")
    @GetMapping("/list")
    public TableDataInfo list(WorkerCertificationAudit workerCertificationAudit) {
        startPage();
        List<WorkerCertificationAudit> list = workerCertificationAuditService.selectWorkerCertificationAuditList(workerCertificationAudit);
        return getDataTable(list);
    }

    /**
     * 获取服务人员认证审核详细信息
     */
    // @PreAuthorize("@ss.hasPermi('workercertificationaudit:workercertificationaudit:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(workerCertificationAuditService.selectWorkerCertificationAuditById(id));
    }

    /**
     * 修改服务人员认证审核
     */
    // @PreAuthorize("@ss.hasPermi('workercertificationaudit:workercertificationaudit:edit')")
    @Log(title = "服务人员认证审核", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody WorkerCertificationAudit workerCertificationAudit) {
        return toAjax(workerCertificationAuditService.updateWorkerCertificationAudit(workerCertificationAudit));
    }
}
